3.2370 \(\int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx\)

Optimal. Leaf size=65 \[ -\sqrt {x^2-x-1}-\tan ^{-1}\left (\frac {3-x}{2 \sqrt {x^2-x-1}}\right )+\frac {1}{2} \tanh ^{-1}\left (\frac {1-2 x}{2 \sqrt {x^2-x-1}}\right ) \]

[Out]

-arctan(1/2*(3-x)/(x^2-x-1)^(1/2))+1/2*arctanh(1/2*(1-2*x)/(x^2-x-1)^(1/2))-(x^2-x-1)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {734, 843, 621, 206, 724, 204} \[ -\sqrt {x^2-x-1}-\tan ^{-1}\left (\frac {3-x}{2 \sqrt {x^2-x-1}}\right )+\frac {1}{2} \tanh ^{-1}\left (\frac {1-2 x}{2 \sqrt {x^2-x-1}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[-1 - x + x^2]/(1 - x),x]

[Out]

-Sqrt[-1 - x + x^2] - ArcTan[(3 - x)/(2*Sqrt[-1 - x + x^2])] + ArcTanh[(1 - 2*x)/(2*Sqrt[-1 - x + x^2])]/2

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 621

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 724

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 734

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m + 1)*(
a + b*x + c*x^2)^p)/(e*(m + 2*p + 1)), x] - Dist[p/(e*(m + 2*p + 1)), Int[(d + e*x)^m*Simp[b*d - 2*a*e + (2*c*
d - b*e)*x, x]*(a + b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ
[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && GtQ[p, 0] && NeQ[m + 2*p + 1, 0] && ( !RationalQ[m] || Lt
Q[m, 1]) &&  !ILtQ[m + 2*p, 0] && IntQuadraticQ[a, b, c, d, e, m, p, x]

Rule 843

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx &=-\sqrt {-1-x+x^2}+\frac {1}{2} \int \frac {-3+x}{(1-x) \sqrt {-1-x+x^2}} \, dx\\ &=-\sqrt {-1-x+x^2}-\frac {1}{2} \int \frac {1}{\sqrt {-1-x+x^2}} \, dx-\int \frac {1}{(1-x) \sqrt {-1-x+x^2}} \, dx\\ &=-\sqrt {-1-x+x^2}+2 \operatorname {Subst}\left (\int \frac {1}{-4-x^2} \, dx,x,\frac {3-x}{\sqrt {-1-x+x^2}}\right )-\operatorname {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {-1+2 x}{\sqrt {-1-x+x^2}}\right )\\ &=-\sqrt {-1-x+x^2}-\tan ^{-1}\left (\frac {3-x}{2 \sqrt {-1-x+x^2}}\right )-\frac {1}{2} \tanh ^{-1}\left (\frac {-1+2 x}{2 \sqrt {-1-x+x^2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 65, normalized size = 1.00 \[ -\sqrt {x^2-x-1}-\tan ^{-1}\left (\frac {3-x}{2 \sqrt {x^2-x-1}}\right )-\frac {1}{2} \tanh ^{-1}\left (\frac {2 x-1}{2 \sqrt {x^2-x-1}}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[-1 - x + x^2]/(1 - x),x]

[Out]

-Sqrt[-1 - x + x^2] - ArcTan[(3 - x)/(2*Sqrt[-1 - x + x^2])] - ArcTanh[(-1 + 2*x)/(2*Sqrt[-1 - x + x^2])]/2

________________________________________________________________________________________

fricas [A]  time = 0.81, size = 51, normalized size = 0.78 \[ -\sqrt {x^{2} - x - 1} + 2 \, \arctan \left (-x + \sqrt {x^{2} - x - 1} + 1\right ) + \frac {1}{2} \, \log \left (-2 \, x + 2 \, \sqrt {x^{2} - x - 1} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-x-1)^(1/2)/(1-x),x, algorithm="fricas")

[Out]

-sqrt(x^2 - x - 1) + 2*arctan(-x + sqrt(x^2 - x - 1) + 1) + 1/2*log(-2*x + 2*sqrt(x^2 - x - 1) + 1)

________________________________________________________________________________________

giac [A]  time = 0.34, size = 52, normalized size = 0.80 \[ -\sqrt {x^{2} - x - 1} + 2 \, \arctan \left (-x + \sqrt {x^{2} - x - 1} + 1\right ) + \frac {1}{2} \, \log \left ({\left | -2 \, x + 2 \, \sqrt {x^{2} - x - 1} + 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-x-1)^(1/2)/(1-x),x, algorithm="giac")

[Out]

-sqrt(x^2 - x - 1) + 2*arctan(-x + sqrt(x^2 - x - 1) + 1) + 1/2*log(abs(-2*x + 2*sqrt(x^2 - x - 1) + 1))

________________________________________________________________________________________

maple [A]  time = 0.05, size = 46, normalized size = 0.71 \[ \arctan \left (\frac {x -3}{2 \sqrt {x +\left (x -1\right )^{2}-2}}\right )-\frac {\ln \left (x -\frac {1}{2}+\sqrt {x +\left (x -1\right )^{2}-2}\right )}{2}-\sqrt {x +\left (x -1\right )^{2}-2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-x-1)^(1/2)/(-x+1),x)

[Out]

-((x-1)^2+x-2)^(1/2)-1/2*ln(-1/2+x+((x-1)^2+x-2)^(1/2))+arctan(1/2*(x-3)/((x-1)^2+x-2)^(1/2))

________________________________________________________________________________________

maxima [A]  time = 2.00, size = 58, normalized size = 0.89 \[ -\sqrt {x^{2} - x - 1} + \arcsin \left (\frac {\sqrt {5} x}{5 \, {\left | x - 1 \right |}} - \frac {3 \, \sqrt {5}}{5 \, {\left | x - 1 \right |}}\right ) - \frac {1}{2} \, \log \left (2 \, x + 2 \, \sqrt {x^{2} - x - 1} - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-x-1)^(1/2)/(1-x),x, algorithm="maxima")

[Out]

-sqrt(x^2 - x - 1) + arcsin(1/5*sqrt(5)*x/abs(x - 1) - 3/5*sqrt(5)/abs(x - 1)) - 1/2*log(2*x + 2*sqrt(x^2 - x
- 1) - 1)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ -\int \frac {\sqrt {x^2-x-1}}{x-1} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(x^2 - x - 1)^(1/2)/(x - 1),x)

[Out]

-int((x^2 - x - 1)^(1/2)/(x - 1), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ - \int \frac {\sqrt {x^{2} - x - 1}}{x - 1}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-x-1)**(1/2)/(1-x),x)

[Out]

-Integral(sqrt(x**2 - x - 1)/(x - 1), x)

________________________________________________________________________________________